Skip to content

feat: add experimental transaction support#310

Open
pepicrft wants to merge 3 commits intoplausible:masterfrom
tuist:codex/experimental-transactions
Open

feat: add experimental transaction support#310
pepicrft wants to merge 3 commits intoplausible:masterfrom
tuist:codex/experimental-transactions

Conversation

@pepicrft
Copy link
Copy Markdown

@pepicrft pepicrft commented Apr 20, 2026

Related plausible/ecto_ch#268

We'd like to start using transactional Ecto tests, and for that, we need this library to have support for transactions. This PR addresses that, adding a transaction state that's persisted across the operations.

Summary

  • add experimental transaction support for ClickHouse HTTP sessions
  • track transaction state across BEGIN, COMMIT, ROLLBACK, and query errors
  • add transaction-focused tests, including wire-level fault injection coverage
  • refactor the raw HTTP helper code in faults_test.exs into a parsed request helper and generic response builder

Why

This makes it possible to experiment with Ecto SQL sandbox support on top of ClickHouses experimental transaction feature while keeping the driver tests readable and focused.

Validation

  • mix test test/ch/faults_test.exs test/ch/connection_test.exs

@pepicrft pepicrft force-pushed the codex/experimental-transactions branch from 1781793 to 0acf8c2 Compare April 20, 2026 13:09
@pepicrft pepicrft marked this pull request as ready for review April 20, 2026 13:10
@ruslandoga ruslandoga force-pushed the master branch 2 times, most recently from e19f920 to 8ffff4f Compare May 5, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant